package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * TODO
 *
 * @Author mr.zhao
 * @Date 2025/7/2 13:32
 */
@RestController("agencyBankAccountController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 银行账户相关接口")
public class AgencyBankAccountController {
	@Autowired
	private IBankAccountService bankAccountService;

	@PostMapping
	@ApiOperation("新增或更新银行账号信息")
	public void addBankAccount(@RequestBody BankAccountUpsertReqDTO dto){
		bankAccountService.addBankAccount(dto);
	}

	@GetMapping("/currentUserBankAccount")
	@ApiOperation("获取当前用户银行账号")
	public BankAccountResDTO getBankAccount(){
		BankAccountResDTO dto = bankAccountService.getBankAccount();
		return dto;
	}
}
